Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <h2>Create a JavaScript Object</h2> <p id="demo"></p> <script> var employees = [ { "firstName":"John", "lastName":"Doe" }, { "firstName":"Anna", "lastName":"Smith" }, { "firstName":"Peter", "lastName":"Jones" }, ]; employees[0].firstName="Gilbert"; document.getElementById("demo").innerHTML = employees[0].firstName + " " + employees[0].lastName; </script> </body> <!-- Mirrored from www.w3schools.com/json/tryit.asp?filename=tryjson_objectarray by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:40:57 GMT --> </html>
Result:
Try it Yourself - © w3schools.com